package com.su.lightthings.adapter

import android.content.Context
import android.view.ViewGroup
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.QuickViewHolder
import com.su.lightthings.R
import com.su.lightthings.bean.ScanDeviceBean

class ManuallyDeviceAdapter : BaseQuickAdapter<ScanDeviceBean, QuickViewHolder>() {
    override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: ScanDeviceBean?) {
        item!!
        holder.setText(R.id.tv_device_name, item.name)
        holder.setText(R.id.tv_mac, item.mac)
        holder.setImageResource(R.id.iv_icon, item.icon)
    }

    override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): QuickViewHolder =
        QuickViewHolder(R.layout.adapter_scan_device, parent)
}